package com.wechart.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by silenceholic on 2017/7/3.
 */
@Controller
public class DispatchController {

    @RequestMapping("/")
    public String greeting(
                           @RequestParam(name = "signature",required = false) String signature,
                           @RequestParam(name = "timestamp",required = false) String timestamp,
                           @RequestParam(name = "nonce",required = false) String nonce,
                           @RequestParam(name = "encrypt_type",
                                   required = false) String encType,
                           @RequestParam(name = "msg_signature",
                                   required = false) String msgSignature) {

//        System.out.println(requestBody);
        System.out.println(signature);
        System.out.println(timestamp);
        System.out.println(nonce);
        System.out.println(encType);
        System.out.println(msgSignature);
        System.out.println();

        return "charge";
//        return "/welcome";
    }
    @RequestMapping("test")
    public String hello(){
        return "welcome" ;
    }

    @RequestMapping("")
    public ModelAndView charge()
    {
        ModelAndView modelAndView = new ModelAndView();


        return null;
    }
}
